<!-- 第4章/aiohttp_mysql/tpls/edit.html -->
{% extends "layout.html" %}
{% block body %}
    <form method="post" enctype="application/x-www-form-urlencoded">
        {% if student %}
            <input type="hidden" value="{{ student.id }}"
                   name="student_id">
        {% endif %}
        <table class="table">
            <tbody>
            <tr>
                <td>姓名</td>
                <td>
                    <input type="text" required class="form-control"
                           name="student_name"
                           value="{{ student.student_name if student else '' }}">
                </td>
            </tr>
            <tr>
                <td>年龄</td>
                <td>
                    <input type="number" required class="form-control"
                           name="student_age"
                           value="{{ student.student_age if student else '' }}">
                </td>
            </tr>
            </tbody>
            <tfoot>
            <tr>
                <td colspan="2">
                    <input class="btn btn-primary" type="submit"
                           value="保存">
                </td>
            </tr>
            </tfoot>
        </table>
    </form>
{% endblock %}
